﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using System.IO;
using Portal.Web.Global;
using Portal.Web.Framework;


namespace Portal.Gui.Web.WebParts.AssetTn
{
    public class AssetTNAjaxProcessBll 
    {
        [AjaxPro.AjaxMethod]
        public AjaxReturn ServerSideDoLogin(string SiteId,string LoginName,string Password)
        {
            AjaxReturn oAjaxReturn=new AjaxReturn();
            try
            {
                Environments.CurrentLoginUser = Permission.Login(SiteId, "", LoginName, Password);
                if (Environments.CurrentLoginUser == null) throw new Exception("Tài khoản hoặc mật khẩu không hợp lệ!");
                oAjaxReturn.RetUrl = "default.aspx";
            }
            catch (Exception ex)
            {
                oAjaxReturn.InfoMessage = ex.Message.ToString();
            }
            return oAjaxReturn;
        }
    }
}
